Multiple saved kernel configurations

ABSTRACT

A method, and a corresponding mechanism, are used for generating and managing multiple saved kernel configurations. The method includes retrieving an existing kernel configuration, applying a kconfig command, by which a second kernel configuration is generated, and saving the second kernel configuration.

TECHNICAL FIELD

[0001] The technical field is processes and mechanisms used inconfiguring UNIX® operating systems. More particularly, the technicalfield relates to processes and mechanism for configuring kernel modules.

BACKGROUND

[0002] One central component of a computer system operating in a UNTX®environment is an operating system kernel. In a typical UNIX® system,many applications, or processes may be running. All these processes usea memory-resident kernel to provide system services. The kernel managesthe set of processes that are running on the system by ensuring thateach such process is provided with some central processor unit (CPU)cycles when needed by the processes and by arranging for each suchprocess to be resident in memory so that the process can run whenrequired. The kernel provides a standard set of services that allows theprocesses to interact with the kernel and to simplify the task of theapplication writer. In the UNIX® environment, these services aresometimes referred to as “system calls,” because the process calls aroutine in the kernel (system) to undertake some specific task. Code inthe kernel will then perform the task for the process, and will return aresult to the process. In essence, the kernel fills in the gaps betweenwhat the process intends to happen, and how the system hardware needs tobe controlled to achieve the process's objective.

[0003] The kernel's standard set of services is expressed as kernelmodules (or simply, modules). The kernel typically includes modules suchas drivers, including Streams drivers and device drivers, file systemmodules, scheduling classes, Streams modules, and system calls. Thesemodules are compiled and subsequently linked together to form thekernel. Subsequently, when the system is started or “booted up”, thekernel is loaded into memory.

[0004] Each module in the kernel has its own unique configuration. Somemodules may include tunables, which govern the behavior of the kernel.Some tunables enable optional kernel behavior, and allow a systemadministrator to adapt a kernel to the administrator's own specificdesires. In the discussion that follows, a module means any separatelyconfigurable unit of kernel code; a system file means a flat text filethat contains administrator configuration choices in a compact,machine-readable format; and module metadata means data that describes amodule's capabilities and characteristics.

SUMMARY

[0005] What is disclosed is a method for managing multiple saved kernelconfigurations. The method includes retrieving an existing kernelconfiguration, applying a kconfig command, by which a second kernelconfiguration is generated, and saving the second kernel configuration.

[0006] Also disclosed is a computer readable medium that includesroutines that, when executed, perform the steps of retrieving anexisting kernel configuration, applying a kconfig command, by which asecond kernel configuration is generated, and saving the second kernelconfiguration.

[0007] Finally, what is disclosed is a mechanism for creating multiplesaved kernel configurations. The mechanism includes a saved kernelconfiguration directory where multiple kernel configurations aremaintained, and a kconfig module that receives a kernel configuration.The kconfig module includes kconfig commands capable of being applied tothe kernel configuration to create at least a second kernelconfiguration.

DESCRIPTION OF THE DRAWINGS

[0008] The detailed description will refer to the following figures inwhich like numerals refer to like items, and in which:

[0009]FIG. 1 illustrates an improved kernel configuration structure;

[0010]FIG. 2 is a diagram illustrating an embodiment of a mechanism formanaging multiple saved kernel configurations;

[0011]FIGS. 3 and 4 are flowcharts illustrating routines for managingmultiple saved kernel configurations; and

[0012]FIG. 5 illustrates a computer-readable medium that incorporatesroutines used to manage multiple saved kernel configurations.

DETAILED DESCRIPTION

[0013] In typical UNIX® systems, a kernel is initially built with abasic set of modules. The basic set of modules should comprise at leastthose modules needed to provide the standard set of services toapplications. However, additional modules may be built into the kernelaccording to a system administrator's requirements and specifications.For example, an administrator may prefer to load certain device drivermodules based on the frequency of usage of those modules.

[0014] In a typical UNIX® system, the kernel is stored in a fixedlocation, and the related configuration data files are stored in otherfixed locations. Because these locations are fixed, it is not possible,on prior art systems, to have more than one kernel and one set ofconfiguration data files.

[0015] These features of current UNIX® systems impose some limitationson system flexibility. Furthermore, these systems have only a veryrudimentary means for handling multiple kernel configuration settings.There was no concept of a kernel configuration as a whole. Instead, eachindividual setting was handled separately, and an administrator had toensure manually that they matched. In addition, some configurationsettings were tied to the kernel itself in a manner that prevented themfrom being stored elsewhere. Therefore, users of current systems cannotback up a kernel configuration completely. Finally, there was noreliable way to ensure that the same configuration was used on multiplemachines, since each piece of the configuration had to be manuallysynchronized.

[0016] In at least one current UNIX® environment, the operating systemkernel is a collection of just under 300 modules. Applying therestrictions of current systems to this large set of modules imposessignificant burdens on system administrators.

[0017] In contrast to what is available with current UNIX® systems, anadministrator, once satisfied with a kernel configuration, may desire tosave a copy of the kernel configuration for a variety of reasons. First,the administrator may want to protect the system against inadvertentconfiguration changes. Second, the administrator may want to maintainmultiple kernel configurations, and to be able to switch easily amongthe multiple kernel configurations. For example, the administrator maydesire one kernel configuration for daytime multi-user processing, andanother kernel configuration for nighttime batch processing. Third, theadministrator may want to provide the same exact kernel configurationson multiple platforms.

[0018] Multiple saved kernel configurations can be created in at leastthree ways. In a first method, a currently running kernel configurationis saved. To save the currently running kernel configuration, theadministrator uses kconfig -s. The resulting saved kernel configurationwill include any changes to the currently running kernel configurationthat are being held for next boot.

[0019] In a second method, the administrator copies an existing, savedkernel configuration using kconfig -c.

[0020] In a third method, the administrator uses system files to exportand import the kernel configuration from one system (platform) toanother system. This third method may be used in environments whereevery kernel configuration has a corresponding system file. A systemfile is a flat text file that describes all of the configurationsettings in a compact, machine-readable, portable format.

[0021] System files provide an alternative mechanism for kernelconfiguration because configuration changes can be made by editing asystem file and then using kernel configuration tools to apply thechanges to the module. The changes may be made by using kconfig -e andkconfig -i commands.

[0022] The same procedure that is used for making configuration changesusing system files may be used to copy a kernel configuration from onesystem (or platform) to another system. This method requires exportingthe kernel configuration (using kconfig -e) from a first system, movingthe kernel configuration to a second system, and importing the kernelconfiguration to the second system (using kconfig -i). The result ofthis method is that two system will run compatible versions of the samekernel configuration. If exact versions of the kernel configuration aredesired to be run on two (or more) systems, the -V (Version match) flagcan be applied while importing the kernel configuration on the secondsystem. The -V flag turns on strict version checking, and the importwill fail if the two systems have different versions of kernel modulesinstalled.

[0023] In general, a first module is compatible with a second module ifthe first module has the same major version number as the second module,and an equal or higher minor version number. Each module has a version,which in an embodiment, is a series of integers separated by decimals.For example, a version may be stated as 2.0.1. The first integer isdenoted as the major version number, and the second integer is the minorversion number. The major version number is changed when a module ischanged in a way that makes the module incompatible with other modules.The minor version number is changed when the module changes in abackward compatible fashion. The third integer is the revision number,and indicates changes in an externally invisible fashion. Strict versionchecking requires that all three version numbers match exactly.

[0024] Referring to FIG. 1, an embodiment of a kernel data space 100 isshown to include modules 101, a kernel registry 105, and a kernelexecutable 107. The kernel registry 105 is a hierarchical database thatis persistent across reboots. The kernel executable 107 includes configroutines and other kernel code needed to support the modules 101.

[0025] Each module 101 includes kernel code 102 and a modmeta table 103.The code 102 executes a specific function for which the module 101 isdesigned. The modmeta table 103 describes the characteristics andcapabilities of the module 101. Metadata for a module 101 are used bykernel configuration tools when the module 101 is configured. Themetadata are also used by various kernel services while the kennelmodule 101 is in use.

[0026] As is apparent from the above description, the metadata for akernel is comprised of the metadata for each of the kernel's componentmodules. In the context of metadata definitions, a module is any blockof kernel code that should be treated independently during kernelconfiguration. Each kernel module 101 has its associated metadata storedin its own unique modmeta file.

[0027] In an alternative embodiment, the kernel configurations aredescribed in corresponding system files. The system files may be storedoutside the kernel data space 100. FIG. 2 illustrates an environment inwhich the kernel configurations are described by system files. In thisenvironment, a mechanism 200 is used to make multiple copies of thekernel configuration according to one of at least three methods.

[0028] The mechanism 200 includes a directory of saved versions of thekernel configurations 210. The saved versions directory 210 will alwaysinclude a backup. Other saved versions will also be stored in the savedversions directory 210. A kconfig module 101 accesses the saved versiondirectory 210. Using one of an -a (all) flag 222, a -v (verbose) flag224, and a -P (Parse) flag 226, the kconfig module 101 can be used todisplay 230 configuration details for any of the saved kernelconfigurations. The kconfig module 101 can also be used in conjunctionwith command kconfig -s 242 to generate a new saved version of thekernel configuration, and with command kconfig -c 244 to generate a copyof the kernel configuration. The new saved version and the copy may bestored in the saved version directory 210.

[0029] A third method for making multiple copies of the kernelconfiguration uses the kconfig -e (export) command 252 and the kconfig-i (import) command 254, in conjunction with system files 250 to exporta kernel configuration from one system, move the kernel configuration toa second system, and import the kernel configuration to the secondsystem. The imported kernel configuration can be compatible with theexported kernel configuration, or, by applying the -V flag (not shown),and exact match between the kernel configurations can be enforced. Thisthird method is particularly useful when a system administrator desiresto use an exact, or at least a compatible version of the kernelconfiguration on multiple systems.

[0030]FIG. 3 is a flowchart illustrating a routine 300 for making andmanaging multiple copies of kernel configurations using the mechanism200 illustrated in FIG. 2. In FIG. 3, the routine 300 begins (block 310)with retrieving the kernel configuration descriptions from the savedversions directory 210. In block 320, the kconfig module applies one ofthree user-designated flags to the retrieved descriptions. In block 330,the descriptions are displayed to the user. In block 340, the mechanism200 receives one of two kconfig commands, and either saves or copies thedesignated kernel configuration into the saved versions directory 210,block 350. The routine 300 then ends.

[0031]FIG. 4 is a flowchart illustrating a routine 400 or making aversion of a kernel configuration available on multiple systems. In FIG.4, the routine 400 begins when a system file is selected and received,block 410. In block 420, the kconfig -e command is applied to export thekernel configuration. In block 430, the exported kernel configuration ismoved to a second system, and the kconfig -i command is applied. Inblock 440, a query may be generated asking the user to select acompatible version or an exact version of the kernel configuration. If acompatible version is selected, the routine 400 moves to block 460 andthe kernel configuration is imported to the second system. In block 440,if an exact version is required, the -V flag is applied (block 450),invoking strict version matching. Assuming an exact match is possible,the routine moves to block 460 and the exact version of the kernelconfiguration is imported to the second system. If an exact match is notpossible, the attempt to copy the kernel configuration to the secondsystem fails.

[0032]FIG. 5 shows a computer system 300 running a UNIX® operatingsystem, that is capable of multiple kernel configuration management. Acomputer readable medium 310 is provided with appropriate programming,including programming to execute the routines 300 and 400 describedabove. The computer readable medium 310 may be any know medium,including optical discs, magnetic discs, hard discs, and other storagedevices known to those of skill in the art. Alternatively, theprogramming required to implement the routines 300 and 400 may beprovided using a carrier wave over a communications network such as theInternet, for example.

We claim:
 1. A method for managing multiple saved kernel configurations,comprising: retrieving an existing kernel configuration; applying akconfig command, wherein a second kernel configuration is generated; andsaving the second kernel configuration.
 2. The method of claim 1,wherein a kernel configuration includes all data needed to describe theconfiguration of the kernel.
 3. The method of claim 1, furthercomprising applying one of an all flag, a verbose flag, and a Parse flagto the retrieved kernel configuration.
 4. The method of claim 1, furthercomprising displaying details of the retrieved kernel configuration. 5.The method of claim 1, wherein the second kernel configuration is savedwith the existing kernel configuration.
 6. The method of claim 1,wherein the kconfig command comprises a kconfig -s command.
 7. Themethod of claim 1, wherein the kconfig command comprises a kconfig -ccommand.
 8. The method of claim 1, wherein the kconfig command comprisesa kconfig -e command and a kconfig -i command, and wherein applicationof the kconfig command exports the retrieved kernel configuration from afirst system and imports the retrieved kernel configuration to a secondsystem.
 9. The method of claim 8, wherein the retrieved kernelconfiguration is described by a system file.
 10. The method of claim 8,further comprising designating an exact version of the kernelconfiguration to be imported, the designating step comprising applying aV flag.
 11. A computer readable medium comprising routines to managemultiple saved kernel configurations, the routines, when executed,comprising the steps of: retrieving an existing kernel configuration;applying a kconfig command, wherein a second kernel configuration isgenerated; and saving the second kernel configuration.
 12. Thecomputer-readable medium of claim 11, wherein the steps further compriseapplying one of an all flag, a verbose flag, and a Parse flag to theretrieved kernel configuration.
 13. The computer-readable medium ofclaim 11, wherein the steps further comprise displaying details of theretrieved kernel configuration.
 14. The computer-readable medium ofclaim 11, wherein the second version of the kernel configuration issaved with the existing kernel configuration.
 15. The computer-readablemedium of claim 11, wherein the kconfig command comprises a kconfig -scommand.
 16. The computer-readable medium of claim 11, wherein thekconfig command comprises a kconfig -c command.
 17. Thecomputer-readable medium of claim 11, wherein the kconfig commandcomprises a kconfig -e command and a kconfig -i command, and whereinapplication of the kconfig command exports the retrieved kernelconfiguration from a first system and imports the retrieved kernelconfiguration to a second system.
 18. The computer-readable medium ofclaim 17, wherein the retrieved kernel configuration is described in asystem file.
 19. The computer-readable medium of claim 17, wherein thesteps further comprise designating an exact version of the kernelconfiguration to be imported, the designating step comprising applying a-V flag.
 20. The computer-readable medium of claim 11, wherein a kernelconfiguration includes all data needed to describe the configuration ofthe kernel.
 21. A mechanism for managing multiple saved kernelconfigurations, comprising: a saved kernel configuration directory,wherein multiple kernel configurations are maintained; and a kconfigmodule that receives a kernel configuration, the kconfig modulecomprising kconfig commands capable of being applied to the kernelconfiguration, wherein at least a second kernel configuration isgenerated.
 22. The mechanism of claim 21, wherein the kconfig commandcomprises one of kconfig -s and kconfig -c, wherein the second kernelconfiguration is, respectively, saved in the directory and copied to asystem.
 23. The mechanism of claim 22, wherein the kconfig commandscomprise an export command and an import command, wherein the retrievedkernel configuration is exported from a first system and imported to asecond system.
 24. The mechanism of claim 23, further comprising astrict version command, wherein the imported kernel configuration is anexact copy of the exported kernel configuration.